#pragma once
#include <iostream>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/string_cast.hpp>

enum class MOVE_DIRECTION : uint8_t
{
	FRONT,
	BACK,
	LEFT,
	RIGHT,
};

class Camera
{
private:
	glm::vec3 mPosition;
	glm::vec3 mFront;
	glm::vec3 mUp; // look direction, opposite to camera's z axis direction
	float mSpeed = 0.001f;

	double mPreXPos = 0;
	double mPreYPos = 0;

	double mPitchDegree = 0;
	double mYawDegree = -90;

	bool mFirstMove = true;

	float mSensitivity = 0.001f;
public:
	Camera() {
		mPosition = glm::vec3(0.0f, 0.0f, 3.0f);
		mFront = glm::vec3(0.0f, 0.0f, -1.0f);
		mUp = glm::vec3(0.0f, 1.0f, 0.0f);
		mSpeed = 0.001f;

		mPreXPos = 0;
		mPreYPos = 0;

		mFirstMove = true;
		mSensitivity = 0.1f;
	}
	Camera(glm::vec3 position, glm::vec3 front, glm::vec3 up, float speed) {
		this->mPosition = position;
		this->mFront = front;
		this->mUp = up;
		this->mSpeed = speed;
	}
	~Camera() {}
	glm::mat4 getViewMatrix() const;
	void processKeyboard(MOVE_DIRECTION direction);
	void processMouseMovement(double xPos, double yPos);
};

